package com.ruoyi.movie.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.movie.mapper.ActorMapper;
import com.ruoyi.movie.domain.Actor;
import com.ruoyi.movie.service.IActorService;
import com.ruoyi.common.utils.DateUtils;

/**
 * 演员管理Service业务层处理
 *
 * @author ruoyi
 */
@Service
public class ActorServiceImpl implements IActorService
{
    @Autowired
    private ActorMapper actorMapper;

    /**
     * 查询演员
     *
     * @param actorId 演员ID
     * @return 演员
     */
    @Override
    public Actor selectActorByActorId(Long actorId)
    {
        return actorMapper.selectActorByActorId(actorId);
    }

    /**
     * 查询演员列表
     *
     * @param actor 演员
     * @return 演员
     */
    @Override
    public List<Actor> selectActorList(Actor actor)
    {
        return actorMapper.selectActorList(actor);
    }

    /**
     * 新增演员
     *
     * @param actor 演员
     * @return 结果
     */
    @Override
    public int insertActor(Actor actor)
    {
        actor.setCreateTime(DateUtils.getNowDate());
        return actorMapper.insertActor(actor);
    }

    /**
     * 修改演员
     *
     * @param actor 演员
     * @return 结果
     */
    @Override
    public int updateActor(Actor actor)
    {
        actor.setUpdateTime(DateUtils.getNowDate());
        return actorMapper.updateActor(actor);
    }

    /**
     * 批量删除演员
     *
     * @param actorIds 需要删除的演员ID
     * @return 结果
     */
    @Override
    public int deleteActorByActorIds(Long[] actorIds)
    {
        return actorMapper.deleteActorByActorIds(actorIds);
    }

    /**
     * 删除演员信息
     *
     * @param actorId 演员ID
     * @return 结果
     */
    @Override
    public int deleteActorByActorId(Long actorId)
    {
        return actorMapper.deleteActorByActorId(actorId);
    }
}